import { request } from '@/utils/request';
import LogApi from '@/core/permission/modules/sys/log';

export function getReqLogList(query: API.PageParams) {
  return request<API.TableListResult>(
    {
      url: LogApi.req,
      method: 'get',
      params: query,
    },
    {
      isMock: true,
    },
  );
}

export function getLoginLogList(query: API.PageParams) {
  return request<API.TableListResult<API.LoginLogListResult>>({
    url: LogApi.login,
    method: 'get',
    params: query,
  });
}

export function getTaskLogList(query: API.PageParams) {
  return request<API.TableListResult<API.TaskLogListResult>>({
    url: LogApi.task,
    method: 'get',
    params: query,
  });
}

// 日志列表
export function queryLogList(data:any) {
  return request({
    url: '/api/log/findList',
    method: 'post',
    data,
  });
}
//数据源列表  
export function dataSorceList(data:any) {
  return request({
    url: '/api/sourceManager/findList',
    method: 'post',
    data,
  });
}
//数据源列表 新增 
export function dataSorceAdd(data:any) {
  return request({
    url: '/api/sourceManager/add',
    method: 'post',
    data,
  });
}

//数据源列表 删除
export function dataSorceDelete(data:any) {
  return request({
    url: `/api/sourceManager/deleteById/${data}`,
    method: 'post',
    // data,
  });
}

//数据源列表 更新
export function dataSorceUpdate(data:any) {
  return request({
    url: '/api/sourceManager/update',
    method: 'post',
    data,
  });
}

//道路基本信息导入  
export function importRoadBasicJson(data:any) {
  return request({
    url: '/api/sourceManager/importRoadBasicJson',
    method: 'post',
    data,
  });
}
